<template>
	<view class="about clearfix">
		<cu-custom bgColor="bg-white" isBack>
			<block slot="content">我的{{title}}</block>
		</cu-custom>
		<view class="mt5 bg-white px15 flex align-center h55 f16">
			<view class="titles">姓名</view>
			<input v-model="name"  disabled placeholder-class="text-info" placeholder="请输入您的真实姓名" />
		</view>
		<view class="mt1 bg-white px15 flex align-center h55 f16">
			<view class="titles">支付宝号</view>
			<input v-model="idcard" disabled placeholder-class="text-info" placeholder="请输入您要收款的支付宝号" />
		</view>
		<view class="flex align-start f12 py20 flex-wrap px15">
			<text class="text-red">注：</text>
			<text>请填入您</text>
			<text class="text-red">真实有效</text>
			<text>的姓名及支付宝号，已确保</text>
			<text>能提现成功到您的支付宝号上</text>
		</view>
		<view class="shiming-button discenter f16 text-white" @click="del">解除绑定</view>
	</view>
</template>

<script>
import { mapState, mapActions } from 'vuex'
export default {
	data() {
		return {
			name:'',
			idcard:'',
			title:'',
			typeindex:0,
			id:'',
			type:'0'
		}
	},
	onLoad(e) {
		this.type=e.type
		if(this.type=='0'){
			this.title='支付宝'
			this.typeindex=e.airindex
			this.getData()
		}else{
			this.title='微信'
			this.typeindex=e.wxindex
			this.getData()
		}
		
	},
	methods: {
		async getData() {
			let {
				data
			} = await this.$http.post('user.paylist')
			this.name=data[this.typeindex].userName
			this.idcard=data[this.typeindex].zfbNum
			this.id=data[this.typeindex].id
		},
		async del(){
			if(this.type=='0'){
				let {data} = await this.$http.post('user.delzfb', {zfbId:this.id}, { tipConfig: { storeLoading: true, isSuccessTip: true, isSuccessBack: true, navigateBack: 1 } })
				this.setUpdate(true)
			}else{
				let {data} = await this.$http.post('user.delwx', {wxId:this.id}, { tipConfig: { storeLoading: true, isSuccessTip: true, isSuccessBack: true, navigateBack: 1 } })
				this.setUpdate(true)	
			}
		}
	}
}
</script>

<style lang="less">
.titles{
	width:240rpx;
}
.shiming-button{
	width: calc(100% - 60rpx);
	margin-left: 30rpx;
	margin-top: 40rpx;
	height: 90rpx;
	border-radius: 10rpx;
	background-color: #D53932;
}
</style>
